package com.FindMyStuff.Model;

import java.util.Date;
@SuppressWarnings("unused")
public class Item {
	/**
	 * Primary Key of the ITem
	 */
	private int _id;
	/**
	 * Name of the Item
	 */
	public String name;
	/**
	 * Description of the Item
	 */
	public String description;
	/**
	 * Location where item was found
	 */
	public String location;
	/**
	 * What status the item is in
	 */
	private ItemStatus status;
	/**
	 * What kind of item it is
	 */
	private ItemCategory category;
	/**
	 * If the item is lost or found
	 */
	private ItemType type;
	/**
	 * Reward offered for finding the idea
	 */
	public double reward;
	/**
	 * Date entered into the system
	 */
	private Date date;
	/**
	 * Email of the user how entered this info
	 */
	private String owner;
	
	public Item(int id, String name, String description, String location, ItemStatus status, ItemCategory category,
			 Double reward, ItemType type, Date date, String owner)
	{
		_id = id;
		this.name= name;
		this.description = description;
		this.location = location;
		this.status = status;
		this.category = category;
		this.type = type;
		this.reward = reward;
		this.date = date;
		this.owner = owner;
	}
	
	public Item()
	{
		
	}

	/**
	 * Returns category of the item
	 * @return ItemCategory
	 */
	public ItemCategory getItemCategory() {
		return category;
	}
	
	/**
	 * Returns date of the item
	 * @return Date
	 */
	public Date getDate()
	{
		return date;
	}
	
	/**
	 * Returns type of the item
	 * @return ItemType
	 */
	public ItemType getItemType() {
		return type;
	}
	
	public String toString()
	{
		if(description.length() > 20)
		{
			return "Item: " + name + "\n" + "\t" + description.substring(0, 20);
		} 
		return "Item: " + name + "\n" + "\t" + description; //change later
	}

	public boolean exist() {
		return true;
	}
}
